package service.impl;


import bean.dto.PermissionQueryPage;
import bean.dto.RoleQueryPage;
import bean.dto.RolesDTO;
import bean.pojo.Permissions;
import bean.pojo.Roles;
import bean.vo.PermissionsOption;
import bean.vo.RoleVo;
import bean.vo.RouterVo;
import commons.r.R;
import dao.PermissionDao;
import dao.RoleDao;
import dao.impl.PermissionDaoImpl;
import dao.impl.RoleDaoImpl;
import service.PermissionService;
import service.RolesService;

import java.util.Collections;
import java.util.List;

/**
 * service.impl
 * User: mcw
 * Date: 2024/12/16 上午10:10
 * motto:   春天（spring）没有虫子（bug)
 * Description:
 * Version: V1.0
 */
public class RolesServiceImpl implements RolesService {
    private RoleDao roleDao=new RoleDaoImpl();


    /**
     * 查询所有记录数
     * @param queryPage
     * @return
     */
    @Override
    public Long findByTotal(RoleQueryPage queryPage) {
        return roleDao.findByTotal(queryPage);
    }

    /**
     * 分页查询
     * @param queryPage
     * @return
     */
    @Override
    public List<Roles> findByPage(RoleQueryPage queryPage) {
        return roleDao.findByPage(queryPage);
    }

    /**
     * 添加权限信息
     * @param roles
     * @return
     */
    @Override
    public boolean insert(RolesDTO roles) {
        return roleDao.insert(roles);
    }

    /**
     * 根据id删除权限
     * @param roleId
     * @return
     */
    @Override
    public boolean deleteById(Integer roleId) {
        return roleDao.deleteById(roleId);
    }

    /**
     * 修改权限信息
     * @param roles
     * @return
     */
    @Override
    public boolean update(RolesDTO roles) {
        return roleDao.update(roles);
    }

    @Override
    public List<RoleVo> findAllList() {
        return roleDao.findAllList();
    }
}
